package com.cup.wx.statemachine.orderdemo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.statemachine.StateMachine;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
 
/** 
 * 
 * 
 */
@RestController
public class TestController {
	
	@Autowired
	private StateMachine<States, Events> stateMachine;
	
	@RequestMapping("/demotest")
	@ResponseBody
	public void testMachine() {
		stateMachine.start();
		stateMachine.sendEvent(Events.PAY);
		stateMachine.sendEvent(Events.RECEIVE);
	}
}